package com.ruoyi.community.service.ec.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.EcActivityMapper;
import com.ruoyi.community.domain.EcActivity;
import com.ruoyi.community.service.ec.IEcActivityService;

/**
 * 社区电商Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-15
 */
@Service
public class EcActivityServiceImpl implements IEcActivityService 
{
    @Autowired
    private EcActivityMapper ecActivityMapper;

    /**
     * 查询社区电商
     * 
     * @param activityId 社区电商ID
     * @return 社区电商
     */
    @Override
    public EcActivity selectEcActivityById(Integer activityId)
    {
        return ecActivityMapper.selectEcActivityById(activityId);
    }

    public List<EcActivity> selectEcActivityByRestaurantId(Long restaurantId){
        return ecActivityMapper.selectEcActivityByRestaurantsId(restaurantId);
    }

    /**
     * 查询社区电商列表
     * 
     * @param ecActivity 社区电商
     * @return 社区电商
     */
    @Override
    public List<EcActivity> selectEcActivityList(EcActivity ecActivity)
    {
        return ecActivityMapper.selectEcActivityList(ecActivity);
    }

    /**
     * 新增社区电商
     * 
     * @param ecActivity 社区电商
     * @return 结果
     */
    @Override
    public int insertEcActivity(EcActivity ecActivity)
    {
        return ecActivityMapper.insertEcActivity(ecActivity);
    }

    /**
     * 修改社区电商
     * 
     * @param ecActivity 社区电商
     * @return 结果
     */
    @Override
    public int updateEcActivity(EcActivity ecActivity)
    {
        return ecActivityMapper.updateEcActivity(ecActivity);
    }

    /**
     * 批量删除社区电商
     * 
     * @param activityIds 需要删除的社区电商ID
     * @return 结果
     */
    @Override
    public int deleteEcActivityByIds(Integer[] activityIds)
    {
        return ecActivityMapper.deleteEcActivityByIds(activityIds);
    }

    /**
     * 删除社区电商信息
     * 
     * @param activityId 社区电商ID
     * @return 结果
     */
    @Override
    public int deleteEcActivityById(Integer activityId)
    {
        return ecActivityMapper.deleteEcActivityById(activityId);
    }
}
